{extend name="base" /}
{block name="body"}
<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">广告管理</li>
            <li class=""><a href="{:url('admin/ad/add')}">添加广告</a></li>
        </ul>
        <div class="layui-tab-content">
            <form action="" method="post" class="ajax-form">
            <button type="button" class="layui-btn layui-btn-danger layui-btn-small ajax-action" data-action="{:url('admin/ad/delete')}">删除</button>

            <div class="layui-tab-item layui-show">
                <table class="layui-table">
                    <thead>
                    <tr>
                        <th style="width: 15px;"><input type="checkbox" class="check-all"></th>
                        <th style="width: 30px;">ID</th>
                        <th style="width: 30px;">排序</th>
                        <th>名称</th>
                        <th>所属广告位</th>
                        <th>开始时间</th>
                        <th>结束时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {if condition="$slide_list"}
                    {foreach name="slide_list" item="vo"}
                    <tr>
                        <td><input type="checkbox" name="ids[]" value="{$vo.id}"></td>
                        <td>{$vo.id}</td>
                        <td>{$vo.sort}</td>
                        <td>{$vo.name}</td>
                        <td>{$slide_category_list[$vo['posid']]}</td>
                        <td>{$vo['start_time'] ? date('Y-m-d H:i:s',$vo['start_time']): '永久'}</td>
                        <td>{$vo['end_time'] ? date('Y-m-d H:i:s',$vo['end_time']): '永久'}</td>
                        <td>
                            <a href="{:url('admin/ad/edit',['id'=>$vo['id']])}" class="layui-btn layui-btn-normal layui-btn-mini">编辑</a>
                            <a href="{:url('admin/ad/delete',['id'=>$vo['id']])}" class="layui-btn layui-btn-danger layui-btn-mini ajax-delete">删除</a>
                        </td>
                    </tr>
                    {/foreach}
                    {else/}
                    <tr>
                        <td colspan="15" style="text-align: center;"><i class="fa fa-exclamation-circle"></i>没有数据</td>
                    </tr>
                    {/if}
                    </tbody>
                </table>
            </div>
            </form>
        </div>
    </div>
</div>
{/block}